package com.wlr.study.leetcode;

public class LeetCode125 {

    public static boolean isPalindrome(String s) {
        s = s.replaceAll("\\W", "").toLowerCase();
        s = s.replaceAll("_", "");
        StringBuilder newStr = new StringBuilder(s);
        return s.contentEquals(newStr.reverse());
    }

    public static void main(String[] args) {
        String s = "ab_a";
        System.out.println(LeetCode125.isPalindrome(s));
    }
}
